import request from "@/utils/request";

// 查询物料入库列表
export function listMaterialin(query) {
  return request({
    url: "/mes/materialin/list",
    method: "get",
    params: query,
  });
}

// 查询物料入库详细
export function getMaterialin(id) {
  return request({
    url: "/mes/materialin/" + id,
    method: "get",
  });
}

// 新增物料入库
export function addMaterialin(data) {
  return request({
    url: "/mes/materialin",
    method: "post",
    data: data,
  });
}

// 修改物料入库
export function updateMaterialin(data) {
  return request({
    url: "/mes/materialin",
    method: "put",
    data: data,
  });
}
// 删除物料入库
export function delMaterialin(id) {
  return request({
    url: "/mes/materialin/" + id,
    method: "delete",
  });
}

// 物料领用/物料退货查询物料入库明细列表
export function detailMaterialin(query) {
  return request({
    url: "/mes/material/detail",
    //url: "/mes/materialin/detail",
    method: "get",
    params: query,
  });
}

// 查询物料入库明细列表
export function materialinDetail(query) {
  return request({
    url: "/mes/materialin/detail",
    method: "get",
    params: query,
  });
}
// 导出
export const materialinExport = (data) => {
  return request({
    url: "mes/materialin/export",
    method: "post",
    data,
    responseType: "blob",
  });
};
